package cn.ac.jaas.isc.vegetable.common.security.exception;

import cn.ac.jaas.isc.vegetable.common.security.component.VegetableAuth2ExceptionSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

/**
 * @author 张高昌
 * @date 2022/4/23 10:06
 * @description: 自定义OAuth2Exception
 */
@JsonSerialize(using = VegetableAuth2ExceptionSerializer.class)
public class VegetableAuth2Exception extends OAuth2Exception {

    @Getter
    private String errorCode;

    public VegetableAuth2Exception(String msg) {
        super(msg);
    }

    public VegetableAuth2Exception(String msg, Throwable t) {
        super(msg, t);
    }

    public VegetableAuth2Exception(String msg, String errorCode) {
        super(msg);
        this.errorCode = errorCode;
    }
}
